package day29;

import javax.swing.JPanel;

import java.awt.Label;
import java.awt.TextArea;

import javax.swing.JTextField;
import javax.swing.JButton;
import javax.swing.JLabel;

import java.awt.Color;

import javax.swing.JScrollPane;
import javax.swing.JTextArea;

import java.awt.BorderLayout;
import java.awt.event.ActionListener;
import java.awt.event.ActionEvent;
import java.util.Set;

public class MatarSearchPanel extends JPanel {
	private JTextField textField;
	private JTextArea textArea;

	/**
	 * Create the panel.
	 */
	public MatarSearchPanel() {
		setLayout(new BorderLayout(0, 0));
		
		JPanel panel = new JPanel();
		add(panel, BorderLayout.NORTH);
		panel.setLayout(new BorderLayout(0, 0));
		
		textField = new JTextField();
		panel.add(textField);
		textField.setColumns(10);
		
		JButton btnNewButton = new JButton("검색");
		if (btnNewButton ==null){
			btnNewButton = new JButton("검색");
			btnNewButton.addActionListener(new ActionListener() {
			public void actionPerformed(ActionEvent arg0) {
				
			Set<String> key	MaterFrame.map.keySet();
			for(String k : key){
				MaterCode mc = MaterFrame.map.get(k);
				if(mc.compare(findStr.getText()){
					textArea.append(mc+"\n");
					textArea.setText("");
				}	
				}
			}
			});
	}return btnNewButton;
	
		panel.add(btnNewButton, BorderLayout.EAST);
		
		
		
		
 
		
		JLabel lblNewLabel = new JLabel("New label");
		lblNewLabel.setForeground(Color.LIGHT_GRAY);
		lblNewLabel.setOpaque(true);
		add(lblNewLabel, BorderLayout.SOUTH);
		
		textArea = new JTextArea();
		add(textArea, BorderLayout.CENTER);

	}
}
